<html>
<head><meta charset="utf-8"><title>Issue clippy#6064 · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html">Issue clippy#6064</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224746333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224746333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshitomo Nakanishi <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224746333">(Feb 01 2021 at 15:56)</a>:</h4>
<p>I'm sorry to bother you again.<br>
What do you think about the inverted approach that you suggested, that is,  implement the strictest rule at first, then incrementally relax the rule? <br>
I mean, we implement the strictest rule that raises warning to all appearance of unsuffixed literals bound to i32/f64 at first, then incrementally relax the rule while avoiding false-negative.  This improves the reliability of the lint and matches the real use case.</p>



<a name="224755284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224755284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224755284">(Feb 01 2021 at 16:50)</a>:</h4>
<p>So for restriction lints, this should be fine. Normally we rather go the other way on this. FPs are more annoying to the user than FPs. So I would rather go the way of be conservative and start with a restricted version and then expand it.</p>



<a name="224823458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224823458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshitomo Nakanishi <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224823458">(Feb 02 2021 at 03:10)</a>:</h4>
<p>Thanks a lot (and sorry I mistakenly created a duplicate topic). Then, considering this lint  is classified as restriction,  I start with the strictest version then relax that to reduce FPs.</p>



<a name="224892599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224892599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshitomo Nakanishi <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224892599">(Feb 02 2021 at 16:07)</a>:</h4>
<p>I started writing a code to relax the restriction and found that <code>rustc_typeck::hir_ty_to_ty</code> panics whenever<code>hir::Ty</code> including<code>TyKind::Infer</code> is passed.<br>
Is this a well known issue to clippy contributors? Currently, <code>hir_ty_to_ty</code> passes <code>ItemCtxt</code> to  <code>AstConv::ast_ty_to_ty</code>, it seems this function is assumed to be called from outside of function, right? If so should we wrap it to avoid ICE?</p>



<a name="224894705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224894705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224894705">(Feb 02 2021 at 16:21)</a>:</h4>
<p>If you find a fix for it, LMK. See <a href="https://github.com/rust-lang/rust-clippy/issues/6179">clippy#6179</a>, I'm trying to find a solution for this for months now. I'm afraid I can't help you more.</p>



<a name="224897927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20clippy%236064/near/224897927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshitomo Nakanishi <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20clippy.236064.html#224897927">(Feb 02 2021 at 16:41)</a>:</h4>
<p>Ok! Fortunately, I have some spare time to investigate it, I'll start investigating it while writing a code for this issue.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>